<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<%@ page contentType="text/html; charset=utf-8"%>
	<%@ include file="/commons/taglibs.jsp"%>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
		<title>字典表管理</title>

		<%@ include file="/commons/css_js_head.jsp"%>

		<script type="text/javascript">
//复写Url
doListUrl = "${ctx }/permission/efDictionaryAction!doList.ts";
doAddBeforeUrl = "${ctx }/permission/efDictionaryAction!doFindById.ts";
doUpdateBeforeUrl = "${ctx }/permission/efDictionaryAction!doFindById.ts";
doDelUrl = "${ctx }/permission/efDictionaryAction!doDelete.ts";

//添加之前
function doAddBefore() {
	var _form = document.forms[0];
	if (doAddBeforeUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}

	_form.action = doAddBeforeUrl;
	_form.submit();
}

//更新之前 
function doUpdateBefore(pkId, pkName) {
	var _form = document.forms[0];
	if (doUpdateBeforeUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}

	_form.action = doUpdateBeforeUrl + "?groupName=" + pkName + "&itemValue="
			+ pkId;
	_form.submit();
}

//删除
function doDel(pkId, pkName) {
	var _form = document.forms[0];
	if (doDelUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}

	_form.action = doDelUrl + "?groupName=" + pkName + "&itemValue=" + pkId;
	_form.submit();
}
</script>

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

	</head>
	<body style="overflow-x: hidden">

		<!-- 标题 -->
		<div class="mTitle">
			<span class="hidsearch"><a href="javascript:void(0)"
				onClick="return chg('searchList');" id="ImgArrow"> <img
						src="${ctx}/images/icon_up.gif" id="imgButton" />
			</a> </span>
			<b class="bbig">字典表管理</b><a href="javascript:void(0)"
				onclick="javascript:doAddBefore();">增加字典 </a>
		</div>

		<!-- 查询条件 -->
		<div class="searchBar" id="searchList" style="display: block;">
			<s:form action="/repast/efDictionary!doList.ts" id="form1"
				method="post">
				<table class="searchTable">
					<tr>
						<th>
							组名：
						</th>
						<td>
							<select name="groupName" style="width: 250px">
								<ef:option groupname="DicDicGroupName"
									selectedValue="${groupName}" type="sql" flag="true" link="true"></ef:option>
							</select>
						</td>
						<th>
							描述：
						</th>
						<td>
							<s:textfield name="remark" theme="simple"></s:textfield>
						</td>
						<th>
							类型：
						</th>
						<td>
							<select name="type">
								<ef:option groupname="DicDicType" selectedValue="${type}"
									flag="true" link="true"></ef:option>
							</select>
						</td>

						<td>
							<input name="btn_query" type="button" class="btn" value="查询"
								onclick="doQuery()" />
							<input name="btn_reset" type="button" class="btn" value="清空查询条件"
								onclick="doReset()" />
						</td>
					</tr>
				</table>
			</s:form>
		</div>

		<!-- start 显示内容 -->
		<aa:zone name="zoneList">
			<div class="mainList">

				<table class="listTable">
					<tr>
						<th width="13%">
							组名
						</th>
						<th width="13%">
							描述
						</th>
						<th width="5%">
							类型
						</th>
						<th width="5%">
							值
						</th>
						<th width="10%">
							名称
						</th>
						<th width="40%">
							执行语句
						</th>
						<th>
							操作
						</th>
					</tr>
					<c:forEach var="efDictionary" items="${voList}">
						<tr align=center>
							<td>
								${efDictionary.id.groupname}
							</td>
							<td>
								${efDictionary.remark}
							</td>
							<td>
								${efDictionary.type}
							</td>
							<td>
								${efDictionary.id.itemvalue}
							</td>
							<td>
								${efDictionary.itemname}
							</td>
							<td>
								${efDictionary.exesql}
							</td>
							<td>
								<a
									href="javascript:doUpdateBefore('${efDictionary.id.itemvalue}','${efDictionary.id.groupname}');"><span
									class="icon_edit">&nbsp;</span>修改</a>
								<a
									href="javascript:doDel('${efDictionary.id.itemvalue}','${efDictionary.id.groupname}');"><span
									class="icon_del" onClick="return confirm('您确定要删除吗？')">&nbsp;</span>删除</a>
							</td>

						</tr>
					</c:forEach>
				</table>
			</div>
		</aa:zone>
		<!-- end 显示内容 -->

		<!-- 分页区域  -->
		<div class="Toolbar">
			<div class="listTool">
				<div class="page">

				</div>
			</div>
		</div>

		<script type="text/javascript">
ajaxAnywhere.formName = "form1";
ajaxAnywhere.getZonesToReload = function() {
	return "zoneList";
}
</script>


	</body>
</html>
